package 泛型;

public class Point<T> {
    //T类型参数

    //此时xy的类型不确定，但保证了xy的类型一致性，xy的类型在产生对象时确定
    private T x;
    private T y;


    public T getX() {
        return x;
    }

    public void setX(T x) {
        this.x = x;
    }

    public T getY() {
        return y;
    }

    public void setY(T y) {
        this.y = y;
    }

//    public static T fun(T t){
//        return t;
//    }

    public static <T> T func(T t){
        return t;
    }

    public static void main(String[] args) {
        Point<String> point = new Point();
        point.setX("东经103");
        point.setY("北纬78");
        point.func(123);
    }
}
